<template>
	<view>
		<z-paging safe-area-inset-bottom ref="paging" v-model="dataList" @query="queryList">
			<view slot="top">
				<u-navbar :title="$t('my.evaluate.navBartext')"  :autoBack="true" :fixed="false"></u-navbar>
			</view>
			<view class="content">
				<view v-for="(item,index) in dataList" :key="index" class="item">
					<!-- 商品信息 -->
					<view class="item_top">
						<view class="item_info">
							<u--image :src="item.shop_avatar" width="150rpx" height="150rpx" radius="10"></u--image>
							<view>
								<u--text :text="item.shopname" bold size="16px" color="#000" margin="0 0 10px 0"></u--text>
								<!-- <u--text :text="'消费时间'+item.dissipate" size="13px" color="#989898" margin="0 0 10px 0"></u--text> -->
								<view class="grade">
									<text>星级评分：</text>
									<u-rate :count="5" active-color="#FFC100" inactive-color="#EBEEF0" readonly v-model="item.star"></u-rate>
								</view>
							</view>
						</view>
						<!-- <image class="right" src="/static/image/right.png"></image> -->
					</view>
					<!-- 评论内容  图片  时间 -->
					<view class="comment">
						<u--text :text="item.content" color="#4E4E4E" size="14" lineHeight="44rpx" margin="0 0 10px 0"></u--text>
						<u--text :text="'评论时间：'+item.createtime" color="#989898" size="12" lineHeight="33rpx"></u--text>
						<view class="item_image" v-if="item.images.length>0">
							<u--image v-for="(e,eIndex) in item.images" :src="e" width="100%" height="186rpx" radius="10"></u--image>
						</view>
					</view>
					<!-- 商家回复 -->
					<!-- <view class="merchant_reply">
						<view class="merchant_title">
							<text>商家回复：</text>
							<text>{{item.merchant.time}}</text>
						</view>
						<u--text :text="item.merchant.content" color="#989898" size="13" lineHeight="42rpx"></u--text>
					</view> -->
					<!-- 删除 回复 -->
					<!-- <view class="btn">
						<view class="reply">
							<image src="/static/image/reply.png"></image>
							<text>{{$t('my.evaluate.replyTetx')}}</text>
						</view>
						<view class="reply">
							<image src="/static/image/delete.png"></image>
							<text>{{$t('my.evaluate.delectText')}}</text>
						</view>
					</view> -->
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: []
			};
		},
		methods: {
			queryList(pageNo, pageSize) {
				this.$http.post('wanlshop/user/userComment',{
					page:pageNo,
					limit:pageSize
				}).then(res=>{
					if(res.code==1){
						this.$refs.paging.complete(res.data.data)
					}else{
						this.$refs.paging.complete(false)
					}
				})
			}
		}
	}
</script>
<style>
	page {
		background-color: #f5f7f9;
	}
</style>
<style lang="scss" scoped>
	.content {
		padding: 30rpx;
		.item {
			background-color: #fff;
			padding: 30rpx;
			border-radius: 20rpx;
			margin-bottom: 20rpx;

			.item_top {
				padding-bottom: 30rpx;
				border-bottom: 2rpx dashed #EEEEEE;
				display: grid;
				grid-template-columns: 1fr;
				grid-column-gap: 20rpx;
				align-items: center;

				.item_info {
					display: grid;
					grid-template-columns: 150rpx auto;
					grid-column-gap: 20rpx;
					align-items: center;
				}

				.right {
					width: 44rpx;
					height: 44rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}

				.grade {
					display: flex;
					align-items: center;
					color: #989898;
					font-size: 24rpx;
				}
			}

			.comment {
				margin: 35rpx 0;

				.item_image {
					display: grid;
					grid-template-columns: 1fr 1fr 1fr;
					grid-column-gap: 20rpx;
					grid-row-gap: 20rpx;
					margin-top: 20rpx;
				}
			}

			.merchant_reply {
				background-color: #FAFAFA;
				color: #989898;
				font-size: 26rpx;
				padding: 20rpx;
				margin: 40rpx 0;
				border-radius: 10rpx;
				.merchant_title{
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-bottom: 20rpx;
				}
			}

			.btn {
				display: flex;
				align-items: center;
				justify-content: flex-end;

				.reply {
					margin-left: 40rpx;

					image {
						width: 24rpx;
						height: 26rpx;
					}

					text {
						font-weight: 400;
						color: #1C1C1C;
						line-height: 40rpx;
						font-size: 28rpx;
						margin-left: 10rpx;
					}
				}
			}
		}

		.item:last-child {
			margin-bottom: 0;
		}
	}
</style>
